package com.itheima.homeweek;

import com.sun.org.apache.xpath.internal.objects.XNumber;

public class HomeWeek06 {//猴子买了一筐桃子，每天吃一半再多吃一个，到了第10天只剩下一个，问：这筐桃子总共有多少个。
    public static void main(String[] args) {
        System.out.println(TaoNumber(1));
        System.out.println(TaoNumber(2));
        System.out.println(TaoNumber(3));
        System.out.println(TaoNumber(4));
        System.out.println(TaoNumber(5));
        System.out.println(TaoNumber(6));
        System.out.println(TaoNumber(7));
        System.out.println(TaoNumber(8));
        System.out.println(TaoNumber(9));
        System.out.println(TaoNumber(10));
    }
    public static int TaoNumber(int day){
        if(day == 10){
            return 1;
        }else{
            return (TaoNumber(day+1)+1)*2;
        }
    }
}
